The present invention relates to a controller, and more particularly, to an electronic device controller including an electrically rewritable nonvolatile memory.
A peripheral device, such as an optical disc drive, typically includes a ROM that stores an operation program. A microcomputer (CPU) uses the operation program to control various circuits included in the peripheral device. In recent years, a flash ROM, which is electrically rewritable, is typically used as a ROM for storing such programs. The use of a flash ROM enables the operation program stored in the ROM to be updated when debugging is performed during development of the peripheral device or when update (version upgrade) is required to improve the function of the peripheral device.
Two types of programs are written to the flash ROM. The first type is the above operation program used by the CPU to control each circuit. The second type is an update program used to update the operation program. When the peripheral device is operating normally, the CPU controls circuits in accordance with the operation program written to the flash ROM. When an operation program requires updating, the CPU operates in accordance with an update program written to the flash ROM to rewrite the operation program stored in the flash ROM.
The above describes how the flash ROM functions when the operation and update programs have already been written to the flash ROM. In an initial state, however, no data is written to the flash ROM. More specifically, there is no update program written to the flash ROM in the initial state even though at least the update program must be written to the flash ROM to enable the CPU to write the operation program to the flash ROM.
Thus, a peripheral device maker has a flash ROM maker write initial data, which includes at least the update program, to a flash ROM or uses a ROM writer to write initial data to a flash ROM. The chip of the flash ROM to which the initial data has been written is then soldered to a printed circuit board of the peripheral device. Japanese Laid-Open Patent Publication No. 5-81012 describes a conventional method of rewriting a firmware.
In the flash ROM chip of the prior art, the operation for writing initial data to the flash ROM must be performed before the chip is mounted on the printed circuit board of the peripheral device. This complicates the manufacturing processes of the peripheral device and increases the manufacturing cost of the peripheral device.
Accordingly, in another prior art, a flash ROM to which no data has been written is mounted on a printed circuit board of a peripheral device before an operation program is written to the flash ROM. More specifically, the peripheral device incorporates a mask ROM storing at least an update program. The mask ROM is connected to a CPU. The CPU operates in accordance with the update program stored in the mask ROM. The CPU receives an operation program from an external host computer via an interface, such as an advanced technology attachment (ATA), advanced technology attachment packet interface (ATAPI), and small computer system interface (SCSI). Then, the CPU writes the received operation program to the flash ROM.
However, the mask ROM storing at least the update program is not used during normal operation of the peripheral device. The mask ROM, which is unnecessary during normal operation, increases the chip area of a controller (an integrated circuit for control). Further, this configuration requires the external host computer to provide the initial data. Thus, the cost for writing initial data cannot be reduced.